function addValidStaticIPLimiteRule(){
	
var rowIndexAddStaticIp=1;
	var addValidStaticIPLimiteRuleForm = new Ext.FormPanel( {
		border:false,
		frame: false,
		layout:'form',
		autoScroll: true,
		padding:'5 5 5 5',
    	items:[
			{
	    		xtype : 'textfield',
	    		id:'addStaticIpRuleName',
				fieldLabel : "规则名称",
				allowBlank : false,
				blankText : '此项不能为空，请输入网关IP地址！',
				anchor : '46.4%',
				vtype:"validStaticIp_name",
				validationEvent:"blur"
	    	},
			{
				layout:'column',
				border:false,
//				width:'95%',
				width:620,
				items:[
				{ layout:'form', width:108, border: false, items:[{xtype:'label',style:'font-size:12px;', text:'IP地址:'}]},
				{ layout:'column',id:'newStaticIpContent_0',width:450, border: false, items: [
					{ layout: 'form', width:85, border:false,items:[
						{
							xtype : 'combo',
							id:'staticIp_ipType_0',
							fieldLabel : 'IP类型：',
							hideLabel:true,
							labelSeparator:'',
							hiddenName : 'operateType',
							store :'IPTypeStore',
							displayField : 'text',
							valueField : 'value',
							typeAhead : true,
							mode : 'local',
							triggerAction : 'all',
							emptyText : '请选择...',
							selectOnFocus : true,
							listeners : {
								"beforerender" : function() {
									this.value = 1;
								},
									"select":function(t,newValue,oldValue){
															var n=this.value;
															var thisIdNO=this.id.substring(16,this.id.length);
															if(n==1){
																	Ext.getCmp("staticIpAddIPPeriod_0").setVisible(false);
																	Ext.getCmp("staticIpAddIPRange_0").setVisible(false);
																	Ext.getCmp("staticIpAddIPAddress_0").setVisible(true);
																	Ext.getCmp("newStaticIpContent_0").doLayout();
															}
															if(n==2){
																	Ext.getCmp("staticIpAddIPAddress_0").setVisible(false);
																	Ext.getCmp("staticIpAddIPRange_0").setVisible(false);
																	Ext.getCmp("staticIpAddIPPeriod_0").setVisible(true);
																	Ext.getCmp("newStaticIpContent_0").doLayout();
															}
															if(n==3){
																Ext.getCmp("staticIpAddIPAddress_0").setVisible(false);
																	Ext.getCmp("staticIpAddIPPeriod_0").setVisible(false);
																	Ext.getCmp("staticIpAddIPRange_0").setVisible(true);
																	Ext.getCmp("newStaticIpContent_0").doLayout();
															}
								
														}
							},
							allowBlank : false,
							blankText : '此项不能为空，请选择IP类型！',
							anchor : '85%'
						}
					]},
					
					/* 
					 * IP地址， IP网段， IP范围根据IP类型的选择而改变显示的状态。 
					 * 缺省时IP类型选择“IP地址”，那就相应地显示IP地址相应的输入域，其它2个选项相应的输入域则隐藏。
					*/
					
					// start IP地址
					{ layout:'column', id:'staticIpAddIPAddress_0', width:140, hidden:false, bodyStyle:'background:transparent;', border: false, items: [
						{ layout: 'form', columnWidth:1, border:false,items:[
					    	{
								xtype : 'textfield',
								id:"staticIp_ipAddr_ipAddr_0",
								fieldLabel : "",
								hideLabel:true,
								labelSeparator:'',
								emptyText:'IP地址',
								allowBlank : false,
								blankText : '此项不能为空，请输入IP地址！',
//								anchor : '100%',
								width:123,
								vtype:"normal_ip",
								validationEvent:"blur"
							}
						]}
	
					]},
					// end IP地址
					
					// start IP网段
					{ layout:'column', id:'staticIpAddIPPeriod_0', width:210, hidden:true, bodyStyle:'background:transparent;', border: false, items: [
						{ layout: 'form', width:140, border:false,items:[
					    	{
								xtype : 'textfield',
								id:"staticIp_ipPeriod_startIp_0",
								fieldLabel : "",
								hideLabel:true,
								labelSeparator:'',
								emptyText:'IP',
								allowBlank : false,
								blankText : '此项不能为空，请输入IP地址！',
	//							anchor : '88%'
								width:123,
								vtype:"normal_ip",
								validationEvent:"blur"
							}
						]},
						{ layout: 'form', width:70, border:false,items:[
					    	{
								xtype : 'combo',
								id:"staticIp_ipPeriod_ipMask_0",
								fieldLabel : "子网掩码",
								hideLabel:true,
								labelSeparator:'',
								hiddenName : 'operateType',
								store :'SubnetMaskStore',
								displayField : 'text',
								valueField : 'value',
								typeAhead : true,
								mode : 'local',
								triggerAction : 'all',
								emptyText : '子网掩码',
								selectOnFocus : true,
								allowBlank : false,
								blankText : '此项不能为空，请选择子网掩码！',
								listeners : {
									"beforerender" : function() {
										this.value = 24;
									}
								},
								width:55
					    	}
				    	]}
					]},
					// end IP网段
					
					// start IP范围
					{ layout:'column', id:'staticIpAddIPRange_0', width:362, hidden:true, bodyStyle:'background:transparent;', border: false, items: [
						{ layout: 'form', width:140, border:false,items:[
					    	{
								xtype : 'textfield',
								id:"staticIp_ipRange_startIp_0",
								fieldLabel : "",
								hideLabel:true,
								labelSeparator:'',
								emptyText:'开始IP',
								allowBlank : false,
								blankText : '此项不能为空，请输入开始IP地址！',
	//							anchor : '88%'
								width:123,
								vtype:"normal_ip",
								validationEvent:"blur"
							}
						]},
						{ layout: 'form', width:12, border:false,items:[
							{
								xtype:'label',
								style:'font-size:12px;',
								text:'-'
							}
						]},
						{ layout: 'form', width:140, border:false,items:[
					    	{
								xtype : 'textfield',
								id:"staticIp_ipRange_endIp_0",
								fieldLabel : "",
								hideLabel:true,
								labelSeparator:'',
								emptyText:'结束IP',
								allowBlank : false,
								blankText : '此项不能为空，请输入结束IP地址！',
	//							anchor : '88%'
								width:123,
								vtype:"normal_ip",
								validationEvent:"blur"
					    	}
				    	]},
						{ layout: 'form', width:70, border:false,items:[
					    	{
								xtype : 'combo',
								id:"staticIp_ipRange_ipMask_0",
								fieldLabel : "子网掩码",
								hideLabel:true,
								labelSeparator:'',
								hiddenName : 'operateType',
								store :'SubnetMaskStore',
								displayField : 'text',
								valueField : 'value',
								typeAhead : true,
								mode : 'local',
								triggerAction : 'all',
								emptyText : '子网掩码',
								selectOnFocus : true,
								allowBlank : false,
								blankText : '此项不能为空，请选择子网掩码！',
								listeners : {
									"beforerender" : function() {
										this.value = 24;
									}
								},
								width:55
					    	}
				    	]}
					]}
					// end IP范围
	
				]}
			]}
			,
			{
				//layout:'column',
				id:'contentsFieldStaticIp',
				border:false,
				style:'width:80%;padding:0px; margin-left:108px;',
				items:[]
			},
			{
					layout:'column',
					border:false,
					style:'width:80%;padding:0px; margin-left:106px;',
					items:[
					{ 
							xtype:'button',
							text:'添加更多',
							iconCls:'add',
							tooltip:'添加更多IP地址/IP网段/IP范围',
							cls:'x-form-button-custom',
							handler:function(){
									//新添加行的ID号
								var newRowId="newStaticIpContent_"+rowIndexAddStaticIp;
			/*********************************定义新添加行*************************************/
							var newRow={ layout:'column', border: false, id:newRowId,items: [
								{
										xtype:'button',	
										text:'',
										//id:"del_"+rowIndexAddStaticIp,
										id:"del_"+rowIndexAddStaticIp,
										iconCls:'delete',
										tooltip:'删除',
										cls:'x-form-button-custom',
										handler:function(){
											var thisRowId="newStaticIpContent_"+(this.id.substring(4,this.id.length));
											var thisRow=Ext.getCmp(thisRowId);
											thisRow.hide();
											thisRow.doLayout();
										}
									
								},			
								
								{ layout: 'column', width:85, style:'margin-left:10px;',  border:false,items:[
									{ layout: 'form', width:85, bodyStyle:'background: transparent;', border:false,items:[
										{
											xtype : 'combo',
											fieldLabel : 'IP类型：',
	//												style:'margin-left:35px;',
											id:"staticIp_ipType_"+rowIndexAddStaticIp,
											hideLabel:true,
											labelSeparator:'',
											hiddenName : 'operateType',
											store :'IPTypeStore',
											displayField : 'text',
											valueField : 'value',
											typeAhead : true,
											mode : 'local',
											triggerAction : 'all',
											emptyText : '请选择...',
											selectOnFocus : true,
											listeners : {
												"beforerender" : function() {
													this.value = 1;
												}
																		,
												"select":function(t,newValue,oldValue){
	//												alert("hdhdhdh");
													var n=this.value;
													var thisIdNO=this.id.substring(16,this.id.length);
													if(n==1){
															Ext.getCmp("staticIpAddIPAddress_"+thisIdNO).show();
															Ext.getCmp("staticIpAddIPPeriod_"+thisIdNO).hide();
															Ext.getCmp("staticIpAddIPRange_"+thisIdNO).hide();
															Ext.getCmp("newStaticIpContent_"+thisIdNO).doLayout();
													}
													if(n==2){
															Ext.getCmp("staticIpAddIPAddress_"+thisIdNO).hide();
															Ext.getCmp("staticIpAddIPPeriod_"+thisIdNO).show();
															Ext.getCmp("staticIpAddIPRange_"+thisIdNO).hide();
															Ext.getCmp("newStaticIpContent_"+thisIdNO).doLayout();
													}
													if(n==3){															
															Ext.getCmp("staticIpAddIPAddress_"+thisIdNO).hide();
															Ext.getCmp("staticIpAddIPPeriod_"+thisIdNO).hide();
															Ext.getCmp("staticIpAddIPRange_"+thisIdNO).show();
															Ext.getCmp("newStaticIpContent_"+thisIdNO).doLayout();
													}
						
												}
										},
		
										allowBlank : false,
										blankText : '此项不能为空，请选择IP类型！',
										anchor : '85%'
//										width:80
													
										}
									]}
								]}
								,

										/* 
										 * IP地址， IP网段， IP范围根据IP类型的选择而改变显示的状态。 
										 * 缺省时IP类型选择“IP地址”，那就相应地显示IP地址相应的输入域，其它2个选项相应的输入域则隐藏。
										*/
										
										// start IP地址
										{ layout:'column', id:'staticIpAddIPAddress_'+rowIndexAddStaticIp, width:210, hidden:false, bodyStyle:'background:transparent;', border: false, items: [
											{ layout: 'form', /*columnWidth:1, */ width:140,border:false,items:[
										    	{
													xtype : 'textfield',
													id:"staticIp_ipAddr_ipAddr_"+rowIndexAddStaticIp,
													fieldLabel : "",
													hideLabel:true,
													labelSeparator:'',
													emptyText:'IP地址',
													allowBlank : false,
													blankText : '此项不能为空，请输入IP地址！',
//													anchor : '100%',
													width:123,
													vtype:"normal_ip",
													validationEvent:"blur"
												}
											]}

										]},
										// end IP地址
										
										// start IP网段
										{ layout:'column', id:'staticIpAddIPPeriod_'+rowIndexAddStaticIp, width:275, hidden:true, bodyStyle:'background:transparent;', border: false, items: [
											{ layout: 'form', width:140, border:false,items:[
										    	{
													xtype : 'textfield',
													id:"staticIp_ipPeriod_startIp_"+rowIndexAddStaticIp,
													fieldLabel : "",
													hideLabel:true,
													labelSeparator:'',
													emptyText:'IP',
													allowBlank : false,
													blankText : '此项不能为空，请输入IP地址！',
						//							anchor : '88%'
													width:123,
													vtype:"normal_ip",
													validationEvent:"blur"
												}
											]},
											{ layout: 'form', width:75, border:false,items:[
										    	{
													xtype : 'combo',
													id:"staticIp_ipPeriod_ipMask_"+rowIndexAddStaticIp,
													fieldLabel : "子网掩码",
													hideLabel:true,
													labelSeparator:'',
													hiddenName : 'operateType',
													store :'SubnetMaskStore',
													displayField : 'text',
													valueField : 'value',
													typeAhead : true,
													mode : 'local',
													triggerAction : 'all',
													emptyText : '子网掩码',
													selectOnFocus : true,
													allowBlank : false,
													blankText : '此项不能为空，请选择子网掩码！',
													listeners : {
														"beforerender" : function() {
															this.value = 24;
														}
													},
													width:55
										    	}
									    	]}
										]},
										// end IP网段
										
										// start IP范围
										{ layout:'column', id:'staticIpAddIPRange_'+rowIndexAddStaticIp, width:362, hidden:true, bodyStyle:'background:transparent;', border: false, items: [
											{ layout: 'form', width:140, border:false,items:[
										    	{
													xtype : 'textfield',
													id:"staticIp_ipRange_startIp_"+rowIndexAddStaticIp,
													fieldLabel : "",
													hideLabel:true,
													labelSeparator:'',
													emptyText:'开始IP',
													allowBlank : false,
													blankText : '此项不能为空，请输入开始IP地址！',
						//							anchor : '88%'
													width:123,
													vtype:"normal_ip",
													validationEvent:"blur"
												}
											]},
											{ layout: 'form', width:12, border:false,items:[
												{
													xtype:'label',
													style:'font-size:12px;',
													text:'-'
												}
											]},
											{ layout: 'form', width:140, border:false,items:[
										    	{
													xtype : 'textfield',
													id:"staticIp_ipRange_endIp_"+rowIndexAddStaticIp,
													fieldLabel : "",
													hideLabel:true,
													labelSeparator:'',
													emptyText:'结束IP',
													allowBlank : false,
													blankText : '此项不能为空，请输入结束IP地址！',
						//							anchor : '88%'
													width:123,
													vtype:"normal_ip",
													validationEvent:"blur"
										    	}
									    	]},
											{ layout: 'form', width:70, border:false,items:[
										    	{
													xtype : 'combo',
													id:"staticIp_ipRange_ipMask_"+rowIndexAddStaticIp,
													fieldLabel : "子网掩码",
													hideLabel:true,
													labelSeparator:'',
													hiddenName : 'operateType',
													store :'SubnetMaskStore',
													displayField : 'text',
													valueField : 'value',
													typeAhead : true,
													mode : 'local',
													triggerAction : 'all',
													emptyText : '子网掩码',
													selectOnFocus : true,
													allowBlank : false,
													blankText : '此项不能为空，请选择子网掩码！',
													listeners : {
														"beforerender" : function() {
															this.value = 24;
														}
													},
													width:55
										    	}
									    	]}
										]}
										// end IP范围
									]}
								
								//newRow.id=newRowId;
								Ext.getCmp("contentsFieldStaticIp").add(newRow);
								Ext.getCmp("contentsFieldStaticIp").doLayout();
								rowIndexAddStaticIp++;
							}
						}
					]
				}
			,
			{
				layout:'column',
				border:false,
				style:'width:70%;',
				items:[
				{ layout: 'form', columnWidth:.35, style:'padding-top:3px;', border:false,items:[
					{ 
						xtype:'radio',
		                boxLabel: '启用',
		                checked: true,
						fieldLabel: '规则启用状态',
		                name: 'statue',
		                inputValue: 'up'
					}
				]},
				{ layout: 'form', columnWidth:.30, style:'padding-top:3px;', border:false,items:[
					{ 
						xtype:'radio',
		                labelSeparator: '',
						hideLabel: true,
						fieldLabel: '网络启用状态',
		                boxLabel: '禁用',
		                name: 'statue',
		                inputValue: 'down'
					}
				]}
			]},
	    	{
	    		xtype : 'textarea',
	    		id:'addStaticIpRuleMemo',
				fieldLabel : "备注",
				anchor : '95%'
	    	}

   	 ]
	});


		
    
    var addValidStaticIPLimiteRuleWindow = new Ext.Window ({
		    	title:'添加合法静态IP限制规则',
		    	width:700,
		    	height:350,
		//    	autoHeight: true,
		    	layout:'fit',
		    	autoScroll: true,
		    	bodyStyle:'background:white;',
		    	border: true,
				modal : true,
				maximizable : true,
				resizable: true,
//				border: false,
				items : addValidStaticIPLimiteRuleForm,
				buttons: [ {
				id: 'submit',
				text: '提交',
				handler:function(){}
			},{
				id: 'reset',
				text: '取消',
				handler: function(){
					addValidStaticIPLimiteRuleWindow.close();
				}
			}]
    });
    
    addValidStaticIPLimiteRuleWindow.show();

}
	
	